import request from '@/utils/request'

export function LoginByPhone(username, password) {
  const data = {
    username,
    password
  }
  return request({
    url: '/login/login',
    method: 'post',
    data
  })
}

export function register(form) {
  const data = {
    account: form.phone,

  }
  return request({
    url: '/user/create',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/login/logout',
    method: 'post'
  })
}

export function resetPsw(data) {
  return request({
    url: '/login/resetPsw',
    method: 'put',
    data
  })
}

export function getUserInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}

